#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_exam1.py
# author:王雯雯
# datetime:2024-11-12 
# software: PyCharm

from sqlalchemy import create_engine
from config.config import Config


def test_connection():
    try:
        engine = create_engine(Config.SQLALCHEMY_DATABASE_URI)
        connection = engine.connect()
        print("数据库连接成功！")
        connection.close()
    except Exception as e:
        print("数据库连接失败:", str(e))